package org.zlb.manager.entity;

import javax.persistence.*;
import java.util.Objects;

/**
 * TODO
 *
 * @author zhoulingbo
 * @date 2021/8/10 12:30
 */
@Entity
@Table(name = "org_dept", schema = "admin", catalog = "")
public class OrgDept {
    private long parentId;
    private long deptId;
    private String deptName;
    private int deptLevel;
    private byte deptStatus;
    private int deptSeq;
    private String deptParentAll;
    private String deptManager;
    private String deptSubManager;
    private String deptDesc;

    @Basic
    @Column(name = "PARENT_ID")
    public long getParentId() {
        return parentId;
    }

    public void setParentId(long parentId) {
        this.parentId = parentId;
    }

    @Id
    @Column(name = "DEPT_ID")
    public long getDeptId() {
        return deptId;
    }

    public void setDeptId(long deptId) {
        this.deptId = deptId;
    }

    @Basic
    @Column(name = "DEPT_NAME")
    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    @Basic
    @Column(name = "DEPT_LEVEL")
    public int getDeptLevel() {
        return deptLevel;
    }

    public void setDeptLevel(int deptLevel) {
        this.deptLevel = deptLevel;
    }

    @Basic
    @Column(name = "DEPT_STATUS")
    public byte getDeptStatus() {
        return deptStatus;
    }

    public void setDeptStatus(byte deptStatus) {
        this.deptStatus = deptStatus;
    }

    @Basic
    @Column(name = "DEPT_SEQ")
    public int getDeptSeq() {
        return deptSeq;
    }

    public void setDeptSeq(int deptSeq) {
        this.deptSeq = deptSeq;
    }

    @Basic
    @Column(name = "DEPT_PARENT_ALL")
    public String getDeptParentAll() {
        return deptParentAll;
    }

    public void setDeptParentAll(String deptParentAll) {
        this.deptParentAll = deptParentAll;
    }

    @Basic
    @Column(name = "DEPT_MANAGER")
    public String getDeptManager() {
        return deptManager;
    }

    public void setDeptManager(String deptManager) {
        this.deptManager = deptManager;
    }

    @Basic
    @Column(name = "DEPT_SUB_MANAGER")
    public String getDeptSubManager() {
        return deptSubManager;
    }

    public void setDeptSubManager(String deptSubManager) {
        this.deptSubManager = deptSubManager;
    }

    @Basic
    @Column(name = "DEPT_DESC")
    public String getDeptDesc() {
        return deptDesc;
    }

    public void setDeptDesc(String deptDesc) {
        this.deptDesc = deptDesc;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrgDept orgDept = (OrgDept) o;
        return parentId == orgDept.parentId &&
                deptId == orgDept.deptId &&
                deptLevel == orgDept.deptLevel &&
                deptStatus == orgDept.deptStatus &&
                deptSeq == orgDept.deptSeq &&
                Objects.equals(deptName, orgDept.deptName) &&
                Objects.equals(deptParentAll, orgDept.deptParentAll) &&
                Objects.equals(deptManager, orgDept.deptManager) &&
                Objects.equals(deptSubManager, orgDept.deptSubManager) &&
                Objects.equals(deptDesc, orgDept.deptDesc);
    }

    @Override
    public int hashCode() {
        return Objects.hash(parentId, deptId, deptName, deptLevel, deptStatus, deptSeq, deptParentAll, deptManager, deptSubManager, deptDesc);
    }
}
